using System;
using System.Data;
using System.Collections;
using APP.QUANLY.Common;

namespace RMAS.DAL
{
    /// <summary>
    /// Summary description for DM_VIPCARD.
    /// </summary>
    public class DM_VIPCARD
    {
              private Int32 _ID;
      private Int32 _PartnerID;
      private DateTime _DateOfIssue;
      private DateTime _Expires;
      private string _IDPOS;
        private bool isExisting;
        #region Properties
        public bool IsExisting
        {
              get{return isExisting;}
              set{isExisting = value;}
        }
	      public bool IsSetID; 
      public bool IsIDNullable   
      { 
	 get { return false;  } 
      }
      public Int32 ID
      {
         get { return _ID; }
         set 
	    { 
 		 _ID = value;
		IsSetID = true;
 	    }
      }
    public bool IsSetPartnerID; 
    public bool IsPartnerIDNullable   
    { 
		get { return false;  } 
    }
    public Int32 PartnerID
    {
        get{ return _PartnerID;  }
        set
		{
			_PartnerID = value;
			IsSetPartnerID = true;
		}
    }
    public bool IsSetDateOfIssue; 
    public bool IsDateOfIssueNullable   
    { 
		get { return false;  } 
    }
    public DateTime DateOfIssue
    {
        get{ return _DateOfIssue;  }
        set
		{
			_DateOfIssue = value;
			IsSetDateOfIssue = true;
		}
    }
    public bool IsSetExpires; 
    public bool IsExpiresNullable   
    { 
		get { return false;  } 
    }
    public DateTime Expires
    {
        get{ return _Expires;  }
        set
		{
			_Expires = value;
			IsSetExpires = true;
		}
    }
    public bool IsSetIDPOS; 
    public bool IsIDPOSNullable   
    { 
		get { return false;  } 
    }
    public string IDPOS
    {
        get{ return _IDPOS;  }
        set
		{
			_IDPOS = value;
			IsSetIDPOS = true;
		}
    }

        #endregion

        #region Constructors
        public DM_VIPCARD()
        {
            Reset();
        }
        public DM_VIPCARD(DM_VIPCARD obj)
        {
            	this._ID = obj.ID;
	this._PartnerID = obj.PartnerID;
	this._DateOfIssue = obj.DateOfIssue;
	this._Expires = obj.Expires;
	this._IDPOS = obj.IDPOS;
        }
        #endregion

        public void Reset()
        {
                     _ID = EmptyValues.v_Int32;
         _PartnerID = EmptyValues.v_Int32;
         _DateOfIssue = EmptyValues.v_DateTime;
         _Expires = EmptyValues.v_DateTime;
         _IDPOS = EmptyValues.v_string;
        }

         
        #region Hidden

        /*
        private void readProperties(IDataReader reader)
        {
            try
            {
                                if(!(reader["ID"] is DBNull))
		{
			obj.ID = (Int32)reader["ID"];
		}
                if(!(reader["PartnerID"] is DBNull))
		{
			obj.PartnerID = (Int32)reader["PartnerID"];
		}
                if(!(reader["DateOfIssue"] is DBNull))
		{
			obj.DateOfIssue = (DateTime)reader["DateOfIssue"];
		}
                if(!(reader["Expires"] is DBNull))
		{
			obj.Expires = (DateTime)reader["Expires"];
		}
                if(!(reader["IDPOS"] is DBNull))
		{
			obj.IDPOS = (string)reader["IDPOS"];
		}
//            _ID = (reader["ID"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["ID"];
//            _PartnerID = (reader["PartnerID"] is DBNull)?DalTools.EmptyValues.v_Int32:(Int32)reader["PartnerID"];
//            _DateOfIssue = (reader["DateOfIssue"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["DateOfIssue"];
//            _Expires = (reader["Expires"] is DBNull)?DalTools.EmptyValues.v_DateTime:(DateTime)reader["Expires"];
//            _IDPOS = (reader["IDPOS"] is DBNull)?DalTools.EmptyValues.v_string:(string)reader["IDPOS"];
            }
            catch (Exception ex)
            {
                throw new DalException("Failed to read properties from DataReader.", ex);
            }
        } 
        */

        #endregion


        public void Fill(Int32 ID, Int32 PartnerID, DateTime DateOfIssue, DateTime Expires, string IDPOS)
        {
                     this._ID = ID;
         this._PartnerID = PartnerID;
         this._DateOfIssue = DateOfIssue;
         this._Expires = Expires;
         this._IDPOS = IDPOS;
        }
    }
}